package com.soundfrequencyapp.actions;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.soundfrequencyapp.R;

public class LoadUrlActivity extends Activity {

	public static final String EXTRA_URL = "url";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.screen_activity_load_url);
		
		handleIntent(getIntent());
	}
	
	private void handleIntent(Intent i) {
		if (i != null) {
			String url = i.getStringExtra(EXTRA_URL);
			WebView wv = (WebView) findViewById(R.id.wv);
			wv.setWebViewClient(new WebViewClient() {

				@Override
				public boolean shouldOverrideUrlLoading(WebView view, String url) {
					return false;
				}
				
			});
			wv.loadUrl(url);
		}
	}

}
